<?php
/* 
 * ********* CVS HEADER ********* 
 * 
 * $RCSfile: admmenusupp.php,v $ 
 * $Date: 2005/08/29 15:17:11 $ 
 * $Revision: 1.2 $ 
 * 
 * ********* CVS HEADER ********* 
 */
if($action=="process"){
    $query="DELETE FROM rportal_menu_droit WHERE id_menu='$mid'";
    @rportalrequete($query) or rportalerreur($query,"?op=admmenuliste");
    $query="DELETE FROM rportal_menu_item WHERE id_menu='$mid'";
    @rportalrequete($query) or rportalerreur($query,"?op=admmenuliste");
    $query="DELETE FROM rportal_menu WHERE id='$mid'";
    @rportalrequete($query) or rportalerreur($query,"?op=admmenuliste");
    $query="UPDATE fonction SET id_menu='0' WHERE id_menu='$mid'";
    @rportalrequete($query) or rportalerreur($query,"?op=admmenuliste");
    header("Location: ?op=admmenuliste");
    exit;
}   
$query="SELECT nom FROM rportal_menu WHERE id='$mid'";
$result=rportalrequete($query) or rportalerreur($query,"?op=");
if(rportalnbresult($result)==0){
    header("Location: ?op=admmenuliste");
    exit;
}
$menu=rportalligne($result);
require_once("module/TPLN/TPLN.php"); 
$TPLN = new TPLN; 
$TPLN->Open($op_basepath."tpl/admmenusupp.html"); 
$TPLN->IncludeFile("header","environnement/$session[environnement]/header.php"); 
$TPLN->IncludeFile("footer","environnement/$session[environnement]/footer.php");
$TPLN->Parse("supp","?op=admmenusupp&mid=$mid&action=process");
$TPLN->Parse("retour","?op=admmenuliste");
$TPLN->Parse("menu",$menu['nom']);
$TPLN->Write();
?>